#!/bin/bash
# test_abacus.sh - 测试ABACUS基本功能

# 创建测试目录
mkdir -p test_simple
cd test_simple

# 创建最小化的STRU文件
cat > STRU << 'EOF'
ATOMIC_SPECIES
Be    9.012  Be_ONCV_PBE-1.0.upf

NUMERICAL_ORBITAL
Be_gga_10au_100Ry_6s2p.orb

LATTICE_CONSTANT
1.889726

LATTICE_VECTORS
10.0  0.0  0.0
0.0  10.0  0.0
0.0  0.0  10.0

ATOMIC_POSITIONS
Direct

Be
0.0
1
0.0  0.0  0.0  1  1  1
EOF

# 复制INPUT文件
cp ../INPUT_PARAMETERS .

echo "开始测试ABACUS..."
OMP_NUM_THREADS=1 mpirun -n 2 /home/zxg/software/abacus3.9.014/abacus-develop/build/abacus

if [ $? -eq 0 ]; then
    echo "测试成功！"
else
    echo "测试失败！错误信息："
    cat err.log
fi